package com.designmodel.designmodel.Iterator_Pattern_迭代器模式;

public class Test {

	public static void main(String[] args) {
		List list=new ArrayList();
		list.add(new Integer(1));
		list.add(new Integer(2));
		list.add(new Integer(3));
		System.out.println(list.size());

		Iterator iterator=list.iterator();
		while (iterator.hasNext()){
			System.out.println(iterator.next());
		}

		System.out.println("------------------------------------------------------");
		List list1=new ArrayList();
		list1.add(new Integer(1));
		list1.add(new Integer(2));
		list1.add(new Integer(3));

		Iterator iterator1=list.iterator();
		while (iterator1.hasNext()){
			System.out.println(iterator1.next());
		}

	}

}
